export default function nestToken(tokens) {
    //结果数组
    let nestTokens = []
    //栈数组
    let sections = []
    //收集器
    let collector = nestTokens
    for (let index = 0; index < tokens.length; index++) {
        const token = tokens[index];
        // console.log(token[0])
        //筛选
        switch (token[0]) {
            case '#':
                //收集器放入token
                collector.push(token)
                //入栈
                sections.push(token)
                //修改收集器指向
                collector = token[2] = []
                break;
            case '/':
                //出栈
                sections.pop()
                collector = sections.length > 0 ? sections[sections.length - 1][2] : nestTokens
                break;
            default:
                collector.push(token)
                break;
        }
    }
    return nestTokens
}